/**
 * Created by iryna on 3/10/14.
 */

package project3;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.Arrays;
import java.util.Collections;

public class test2 {
    @DataProvider(name = "test1")
    public Object[][] provideData() {

        return new Object[][] {
                { 10, 9, 8, 11 },
                { 100, 110, 90, 0 },

        };
    }

    @Test(dataProvider = "test1")
    public void test1(int param1, int param2, int param3, int param4)
    {


        Integer[] intArray = new Integer[4];

        intArray[0]=param1;
        intArray[1]=param2;
        intArray[2]=param3;
        intArray[3]=param4;


        System.out.println("\n Elements of Array:\n");
        for(int i:intArray)
            System.out.print(i+" ,");

        System.out.println("\n Elements of Array (Sorted):\n");
        Arrays.sort(intArray);

        for(int i:intArray)
            System.out.print(i+" ,");

        Arrays.sort(intArray,Collections.reverseOrder());

        System.out.println("\n Elements of Array (Sorted in REVERSE):\n");

        for(int i:intArray)
            System.out.print(i+" ,");


    }


}
